// ActionScript file
import mx.controls.Alert;
import mx.managers.CursorManager;
import mx.rpc.events.ResultEvent;

private var userId:String; //用户ID号;
public var power:int=0;//用户权限,0为普通用户,1为管理员
		
private function loginValid( user:String, passwd:String, power:int ):void 
{
	UserService.getOperation('validInfo').send( user, passwd, power );
}
		
private function loginValidHandler( e:ResultEvent ):void
{
	CursorManager.removeBusyCursor();
	if(e.result && power==1)
	{
		userId = e.result.toString();
		backToAdmin();
	}
	else
	{
		if( e.result )
		{
			userId = e.result.toString();
			backToNavi();
		}
		else
		{
			Alert.show( '登录失败，请检查用户名、密码是否正确' );
		}
	}
}
		
private function goReg():void
{
	currentState="reg";
}